refactor: route verify flagged through command module#160
refactor: route verify flagged through command module#160ndycode wants to merge 3 commits intorefactor/pr1-verify-flagged-commandfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…and' into refactor/pr1-route-verify-flagged-direct
Summary
lib/codex-manager.tsWhat Changed
runVerifyFlagged()wrappercodex auth verify-flaggeddispatch to callrunVerifyFlaggedCommand(...)directlyverify-flaggedaction to use the same extracted command pathValidation
npm run test -- test/codex-manager-verify-flagged-command.test.ts test/codex-manager-cli.test.tsnpm run lintnpm run typechecknpm run buildRisk and Rollback
c88cd18to restore the inline verify-flagged wrapperAdditional Notes
note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
removes the last inline
runVerifyFlaggeddispatcher wrapper fromcodex-manager.tsand routes both the cliverify-flaggedcommand and the login-menu problem-account check throughrunVerifyFlaggedCommanddirectly, using a newbuildVerifyFlaggedCommandDeps()factory to construct the typed deps object.changes:
runVerifyFlagged(args)wrapper deleted — it was a thin shell with no logic of its ownbuildVerifyFlaggedCommandDeps(): VerifyFlaggedCommandDepsadded as a typed factory; both call sites now passbuildVerifyFlaggedCommandDeps()inlineVerifyFlaggedCommandDepstype is now imported so the factory return type is statically checked against the command module's interface"runs verify-flagged from the login menu"covers the login-menu dispatch path end-to-end: flags one account, refresh fails (invalid_grant), expects the transaction andsaveFlaggedAccountsto be called exactly onceno behavioral change — the deps object passed to
runVerifyFlaggedCommandis identical to what the old wrapper provided; default args (restore: true,dryRun: false) are unchanged and match the existingcodex-manager-verify-flagged-command.test.tscoverage.Confidence Score: 5/5
VerifyFlaggedCommandDeps; both call sites are mechanically equivalent to what existed before; the new test confirms the login-menu route executes the transaction and save correctly; no token/filesystem safety concerns introducedImportant Files Changed
runVerifyFlaggedwrapper; added typedbuildVerifyFlaggedCommandDeps()factory; both cli-dispatch and login-menu now callrunVerifyFlaggedCommanddirectly — no behavioral changeSequence Diagram
sequenceDiagram participant CLI as runCodexMultiAuthCli participant BLD as buildVerifyFlaggedCommandDeps() participant CMD as runVerifyFlaggedCommand() participant STORAGE as storage (mocked) participant REFRESH as queuedRefresh (mocked) Note over CLI: codex auth verify-flagged CLI->>BLD: construct deps object BLD-->>CLI: VerifyFlaggedCommandDeps CLI->>CMD: runVerifyFlaggedCommand(args, deps) CMD->>STORAGE: loadFlaggedAccounts() CMD->>REFRESH: queuedRefresh(token) REFRESH-->>CMD: TokenResult CMD->>STORAGE: withAccountAndFlaggedStorageTransaction(...) [if restore] CMD->>STORAGE: saveFlaggedAccounts(...) [if flaggedChanged && !storageChanged] CMD-->>CLI: exit code Note over CLI: login menu → verify-flagged action CLI->>BLD: construct deps object BLD-->>CLI: VerifyFlaggedCommandDeps CLI->>CMD: runVerifyFlaggedCommand([], deps) CMD->>STORAGE: loadFlaggedAccounts() CMD->>REFRESH: queuedRefresh(token) REFRESH-->>CMD: TokenResult CMD->>STORAGE: withAccountAndFlaggedStorageTransaction(...) CMD->>STORAGE: saveFlaggedAccounts(...) CMD-->>CLI: exit code (ignored — side-effect only)Reviews (2): Last reviewed commit: "refactor: share verify-flagged command d..." | Re-trigger Greptile